<?php

/* ============================================ */
/*  HypnoPHP Framework - Application Bootstrap  */
/* ============================================ */

$application_environment = 'default';

$this_path = realpath(dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);

switch ($application_environment) {

	case 'default':
		error_reporting(E_ALL);
		// The HypnoPHP Framework system path
		$application_system_path = $this_path . DS . 'system' . DS . 'lib';
		// The Application path
		$application_path = $this_path . DS . 'application';
		break;

	case 'development':
		error_reporting(E_ALL);
		$application_system_path = ''; // The HypnoPHP Framework system path
		$application_path = ''; // The Application path
		break;

	case 'production':
		error_reporting(0);
		$application_system_path = ''; // The HypnoPHP Framework system path
		$application_path = ''; // The Application path
		break;

	case 'testing':
		error_reporting(E_ALL ^ E_NOTICE);
		$application_system_path = ''; // The HypnoPHP Framework system path
		$application_path = ''; // The Application path
		break;
}

$application_system_file = $application_system_path . DS . 'HApplication.php';
if (is_file($application_system_file)) {
	include $application_system_file;
	HApplication::run($application_path, $application_environment);
} else {
	echo '<h3>Error: HypnoPHP Application not found<h3>';
}
